import 'package:flutter_test/flutter_test.dart';
import 'package:infrared_scanner/infrared_scanner.dart';
import 'package:infrared_scanner/infrared_scanner_platform_interface.dart';
import 'package:infrared_scanner/infrared_scanner_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockInfraredScannerPlatform
    with MockPlatformInterfaceMixin
    implements InfraredScannerPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> redScanner() {
    // TODO: implement redScanner
    throw UnimplementedError();
  }
}

void main() {
  final InfraredScannerPlatform initialPlatform = InfraredScannerPlatform.instance;

  test('$MethodChannelInfraredScanner is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelInfraredScanner>());
  });

  test('getPlatformVersion', () async {
    InfraredScanner infraredScannerPlugin = InfraredScanner();
    MockInfraredScannerPlatform fakePlatform = MockInfraredScannerPlatform();
    InfraredScannerPlatform.instance = fakePlatform;

    expect(await infraredScannerPlugin.getPlatformVersion(), '42');
  });
}
